jQuery(function($){
	window.ControlPanel = Spine.Controller.create({
		events: {
			"click .new-project": "newProjectClick",
			"click .my-projects": "myProjectsClick",
			"click .search": "searchClick",
			"click .profile": "profileClick",
			"click .settings": "settingsClick",
			"click .exit": "exitClick",
			"click .feedback": "feedbackClick",
			"click .login-register": "loginRegisterClick"
		},
		
		init: function() {},
		
		newProjectClick: function(){
			this.newProjectPage.active();
		},
		
		myProjectsClick: function(){
			this.profilePage.active();
			this.profilePage.myProjects.active();
		},
		
		searchClick: function(){
			this.searchPage.active();
		},
		
		profileClick: function(){
			this.profilePage.active();
			this.profilePage.myData.active();
		},
		
		settingsClick: function(){
			this.settingsPage.active();
		},
		
		exitClick: function() { alert("exiting!"); },
		
		feedbackClick: function(){
			this.feedbackPage.active();
		},
		
		loginRegisterClick: function(){
			this.loginRegisterPage.active();
		},
	});
});
